#include "SIMcompass.h"

void SIMcompass::read(void)
{
	read(0.,0.,0.);
}

void SIMcompass::read(float y,float p,float r)
{
	simula(y*M_PI/180,p*M_PI/180,r*M_PI/180);
	attitude();
}

void SIMcompass::simula(float y,float p,float r)
{
	point(0,0,-10000);
	rotation(y,p,r);
        project();
	a.x = vector_M[0][0];
	a.y = vector_M[1][0];
	a.z = vector_M[2][0];
	point(10000,0,0);
        project();
	m.x = vector_M[0][0];
	m.y = vector_M[1][0];
	m.z = vector_M[2][0];

}
